<extend name="Public/List/Common"/>
<block name="pageHeader">
    <div class="bjui-pageHeader">
        <form id="pagerForm" data-toggle="ajaxsearch" action="__ACTION__" method="post">
            <input type="hidden" name="cate_id" value="{:I('cate_id');}"/>

            <label>关键词：</label>
            <input value="{$_REQUEST['key']}" name="key" class="form-control" size="15"/>
            <button type="submit" class="btn-default" data-icon="search">查询</button>

            <div class="pull-right">
                <a href="{:U('add', array('cate_id'=>I('cate_id'), model_id=>$model_id))}" class="btn btn-green" data-toggle="navtab"
                   data-id="dialog-normal" data-mask="true" data-icon="plus" data-title="添加分类-文章">添加</a>

                <div class="btn-group">
                    <button type="button" class="btn-default dropdown-toggle" data-toggle="dropdown" data-icon="copy">
                        复选框-批量操作
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu right" role="menu">
                        <li>
                            <a href="{:U('del')}" data-toggle="doajaxchecked" data-confirm-msg="确定要删除选中项吗？"
                               data-idname="id" data-group="ids">删除选中</a>
                        </li>
                    </ul>
                </div>
            </div>
        </form>
    </div>
</block>
<block name="pageContent">
    <div class="bjui-pageContent tableContent">
        <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr>
                <th>
                    文档ID
                </th>
                <th>
                    标题
                </th>
                <th>
                    创建时间
                </th>
                <th>
                    数据状态
                </th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>

            <volist name="articleList" id="vo">

                <tr>
                    <td>
                        {$vo.id}
                    </td>
                    <td>
                        {$vo.title}
                    </td>
                    <td>
                        {$vo.create_time|time_format}
                    </td>
                    <td>
                        {$vo.status|columnToName="DEFAULE_STATUS",###}
                    </td>
                    <td>
                        <a href="{:U('edit?id='.$vo['id'].'&model_id='.$vo['model_id'].'&navTabId=Article'.$vo['id'])}" data-id="Article{$vo.id}" class="btn btn-blue" data-toggle="navtab" data-title="{$vo.title}编辑">编辑</a>
                        <a href="{:U('setstatus?status=-1&ids='.$vo['id'])}" class="btn btn-red" data-toggle="doajax">删除</a>
                        <a href="{:U('user/wechatPush?article_id='.$vo['id'])}" class="btn btn-red" data-toggle="doajax" >推送</a>
                    </td>
                </tr>

            </volist>

            </tbody>
        </table>
    </div>
</block>
<block name="pageJavascript">
    <script>
        function custom_pic_upload_success(file, data, $upload) {
            console.log(file);
            console.log(data);
            console.log($upload);
            var json = $.parseJSON(data)
            if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
                var pic = json.filename
                $upload.next().html('<img src="' + pic + '" width="80" />')
            }else{
                $(this).alertmsg('error', json.message)
            }
        }
    </script>
</block>